import React, { Suspense } from "react";
import Albums from "./Albums";

interface ArtistPageProps {
  artist: {
    id: string;
    name: string;
  };
}
const ArtistPage: React.FC<ArtistPageProps> = ({ artist }) => {
  return (
    <>
      <h1>{artist.name}</h1>
      <Suspense fallback={<Loading />}>
        <Albums artistId={artist.id} />
      </Suspense>
    </>
  );
};

function Loading() {
  return <h2>🌀 Loading...</h2>;
}
export default ArtistPage;
